LabEx Notes
Lab 1: Matching number lines and email, create subdirectories for each.
- In this lab I was tasked with creating a directory to file information in to. One directory was for lines beginning with numbers and another was for emails.
- I first started by using the ‘touch’ command to create both the number and email directory.
- After creating both I used the ‘grep’ command on the data directory to pull all instances of lines with numbers and copying that over to the number directory. I repeated the process again using the ‘grep’ command on the data directory to pull all emails from the data directory and copy it over to the mail directory.
- To confirm I had done the task assigned I used the ‘concatenate’ command on both directories to show that indeed the correct information was in the respective directory.
Lab 2: Adding and removing packages.
- In this lab I was tasked with removing the nginx package and adding a cowsay tool.
- I used the sudo apt command followed by -y to install cowsay.
- I used the sudo apt remove command to remove nginx.
- To verify I completed both tasks I checked using the dpkg command with a -s to check the status. I also piped it through ‘grep’ to get the status on the system.
Lab 3: Creating directory structure for web project.
- This lab I was tasked with creating a visual representation of the directories in the web project.
- As seen in the lab I first created the directories for the front end using the ‘mkdir’ command and followed with the ‘tree’ command to ensure the directories were properly added.
- Following that step I created a backend visual representation using the same command as the first step and confirmed as well using the same command from the second step.
Lab 4: Moving files from directories.
- In this lab I was tasked with moving one file from one directory into another.
- To do this I used the ‘mv’ command to specify which file was moving and where it was moving to.
- I confirmed using the ‘tree’ command to ensure it was out of the configuration directory and in the project directory.
Lab 5: Reading sections of files and moving them into new text files.
- In this lab I was tasked with reading the last 20 and first 15 lines of 2 txt files.
- To read the last 20 lines I used the ‘tail’ command followed by the -n command to specify it would be 20 lines. I followed that with the > command to move it over into a new txt file.
- The same was done with the first 15 lines only instead I used the ‘head’ -n command to read the first 15 lines. I followed that as well with the > command to move it over to a new txt file.